home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / os.291 < prev    next >
Text File  |  1992-02-06  |  1KB  |  25 lines

  1. rcp cshrc protocol violation
  2.  
  3. Q:  Why do I get a "protocol violation" when I try to rcp something?
  4.  
  5. A:  In order for the rcp command to work correctly, your .cshrc must not output anything via the cshell if that cshell is not "interactive."  It turns out that rcp runs a non-interactive cshell on the remote machine in order to exec the remote copy operation -- a pretty dumb way of doing things, but that's the way it does remote file name expansion and the like.  Any extra output from the cshell while rcp is trying to run the remote copy confuses rcp and you end up with the "protocol violation" messages from rcp.
  6.  
  7. The way to determine if the cshell is interactive from your .cshrc is to check if a prompt is defined.  In fact, the most common violation of the no output rule is to assign a prompt when there wasn't one to begin with.  The second most common violation is setting the cshell "time" variable.  The "best" format for your .cshrc is something like this:
  8.  
  9.     set path=( YOUR PATH )
  10.     umask 022 # YOUR UMASK
  11.     if (${?prompt} ) then
  12.         # just about everything else
  13.         # ESPECIALLY anything like setting your prompt
  14.         # setting the cshell "time" variable, etc
  15.     endif
  16.  
  17. It's a GOOD idea to set your path and umask unconditionally in your .cshrc.  Setting the umask makes files rcp'ed to a remote machine end up with the protections you like, and setting your path allows rsh'es to find the same things it would locally.
  18.  
  19. QA291
  20.  
  21. Valid for 1.0 
  22. Valid for 2.0 
  23.  
  24.  
  25.